FROM adoptopenjdk/openjdk11:alpine-jre
# 切换到阿里云镜像 https://mirrors.aliyun.com
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
ENV LANG zh_CN.UTF-8
RUN apk update && apk upgrade && apk add ca-certificates && update-ca-certificates \
    && apk add --update tzdata && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone \
    && rm -rf /var/cache/apk/*
# 维护者
MAINTAINER Fu Zhaohui<fuzhaohui200@gmail.com>
VOLUME /tmp
ADD ./build/libs/ddwl-funds-2.0.RELEASE.jar app.jar
# JDK11支持: -XX:+UseContainerSupport 使JVM能够感知容器资源， -XX:InitialRAMPercentage 初期容器内存占比， -XX:MaxRAMPercentage 最大容器内存占比
ENV JAVA_OPTS="-XX:+UseContainerSupport -XX:InitialRAMPercentage=50 -XX:MaxRAMPercentage=80"
ENTRYPOINT ["sh", "-c", "java -server $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar"]
